interface tileData {
  cardIndex: number,
  count: number,
  suitType: string
}
interface winData {
  actionCard: tileData,
  actionCardMap: Object,
  actionCode: number,
  actionIndex: number,
  actionType: string
}
class Tile extends eui.Component {
  public pokerValue: eui.Image
  public receivePointerShow: boolean = false
  public tileData: tileData
  public cardBg: eui.Image
  public faguang: eui.Image

  public constructor() {
    super()
    this.once(eui.UIEvent.COMPLETE, this.onComplete, this)
    this.skinName = `<e:Skin class="Poker" width="82" height="118" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
      <e:Image source="gamePoker_1_png" x="-2.5" y="0"/>
      <e:Image id="cardBg" source="winPoker_1_png" y="1" x="-3.5" scaleX="1.35" scaleY="1.35"/>
      <e:Image id="pokerValue" y="23" source="S_1_png" smoothing="true" x="-0.5"/>
      <e:Image id="faguang" source="faguangpai_png" percentWidth="100" percentHeight="100" visible="false"/>
    </e:Skin>`
  }
  protected onComplete() {
    this.touchChildren = false
    this.name = 'tile'
  }
  public setContent(_skinName: string) {
    this.pokerValue.source = _skinName
  }
  public setData(tileData: tileData) {
    this.tileData = tileData
    this.cardBg.visible = false
    this.setContent(tileData.suitType + "_" + tileData.count + "_png")
  }
  public setfaguang(faguang: boolean) {
    this.faguang.visible = faguang
  }
}
